package org.sdp.pearproject.dao.domain;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * InterfaceName: ProjectForMydepartmentExample
 * @Description: 
 * @Author: SDP
 * @Date: 2022-07-15
 * @Version: 1.0
 * Table: pear_project
 * Comment:
 * 项目表
 */
public class ProjectForMydepartmentExample {
    protected Integer limitClause;

    protected Integer countClause;

    protected Integer topClause;

    protected ProjectForMydepartment simple;

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public ProjectForMydepartmentExample() {
        oredCriteria = new ArrayList<>();
        simple = new ProjectForMydepartment();
    }

    public void setLimitClause(Integer limitClause) {
        this.limitClause = limitClause;
    }

    public Integer getLimitClause() {
        return limitClause;
    }

    public void setCountClause(Integer countClause) {
        this.countClause = countClause;
    }

    public Integer getCountClause() {
        return countClause;
    }

    public void setTopClause(Integer topClause) {
        this.topClause = topClause;
    }

    public Integer getTopClause() {
        return topClause;
    }

    public void setSimple(ProjectForMydepartment simple) {
        this.simple = simple;
    }

    public ProjectForMydepartment getSimple() {
        return simple;
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    public static ProjectForMydepartmentExample createExample(ProjectForMydepartment request) throws Exception {
        return createExample(request, null);
    }

    public static ProjectForMydepartmentExample createExample(ProjectForMydepartment request, JSONObject options) throws Exception {
        ProjectForMydepartmentExample example = new ProjectForMydepartmentExample();
        example.setSimple(request);
        ProjectForMydepartmentExample.Criteria criteria = example.createCriteria();
        int count = 0;

        if (options != null) {
            String orderBy = "";
            if (options.containsKey("order_by")) {
                JSONArray jsonArray = options.getJSONArray("order_by");
                orderBy = setCriteriaOrderBy(Criterion.toList(jsonArray, CriteriaString.class), example);
                if (orderBy.length() > 0) {
                    example.setOrderByClause(orderBy);
                }
            }
            if (options.containsKey("limit")) {
                example.setLimitClause(+options.getInteger("limit"));
            }
            if (options.containsKey("count")) {
                example.setCountClause(+options.getInteger("count"));
            }
            if (options.containsKey("top")) {
                example.setTopClause(+options.getInteger("top"));
            }

            if(options.containsKey("=")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("="), ProjectForMydepartment.class);
                count += setCriteriaEqualTo(obj, criteria);
            }
            if(options.containsKey(">")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject(">"), ProjectForMydepartment.class);
                count += setCriteriaGreaterThan(obj, criteria);
            }
            if(options.containsKey(">=")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject(">="), ProjectForMydepartment.class);
                count += setCriteriaGreaterThanOrEqualTo(obj, criteria);
            }
            if(options.containsKey("!null")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("!null"), ProjectForMydepartment.class);
                count += setCriteriaIsNotNull(obj, criteria);
            }
            if(options.containsKey("null")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("null"), ProjectForMydepartment.class);
                count += setCriteriaIsNull(obj, criteria);
            }
            if(options.containsKey("<")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("<"), ProjectForMydepartment.class);
                count += setCriteriaLessThan(obj, criteria);
            }
            if(options.containsKey("<=")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("<="), ProjectForMydepartment.class);
                count += setCriteriaLessThanOrEqualTo(obj, criteria);
            }
            if(options.containsKey("like")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("like"), ProjectForMydepartment.class);
                count += setCriteriaLike(obj, criteria);
            }
            if(options.containsKey("!=")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("!="), ProjectForMydepartment.class);
                count += setCriteriaNotEqualTo(obj, criteria);
            }
            if(options.containsKey("!like")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("!like"), ProjectForMydepartment.class);
                count += setCriteriaNotLike(obj, criteria);
            }
            if(options.containsKey("regexp")) {
                ProjectForMydepartment obj = JSONObject.toJavaObject(options.getJSONObject("regexp"), ProjectForMydepartment.class);
                count += setCriteriaRegexp(obj, criteria);
            }

        }

        return example;
    }

    private static int appendCriteriaOrderByItem(StringBuilder sb, String name, String value) throws Exception {
        if (value == null) {
            return 0;
        }
        if (sb.length() > 0) {
            sb.append(",");
        }
        value = value.trim();
        if ("desc/gbk".equals(value)) {
            sb.append("convert(");
            sb.append(name);
            sb.append(" using gbk) desc");
        } else if ("asc/gbk".equals(value)) {
            sb.append("convert(");
            sb.append(name);
            sb.append(" using gbk) asc");
        } else if ("desc".equals(value)) {
            sb.append(name);
            sb.append(" desc");
        } else if ("asc".equals(value) || "".equals(value)) {
            sb.append(name);
            sb.append(" asc");
        } else {
            throw new Exception("非法的order by类型:"+value);
        }
        return 1;
    }

    private static String setCriteriaOrderBy(List<Object> request, ProjectForMydepartmentExample example) throws Exception {
        StringBuilder sb = new StringBuilder();
        for(Object criteriaOrderByObj: request) {
            CriteriaString criteriaOrderBy = (CriteriaString)criteriaOrderByObj;
            int subCount = 0;

            subCount += appendCriteriaOrderByItem(sb, "id", criteriaOrderBy.getId());
            subCount += appendCriteriaOrderByItem(sb, "code", criteriaOrderBy.getCode());
            subCount += appendCriteriaOrderByItem(sb, "organization_code", criteriaOrderBy.getOrganizationCode());
            subCount += appendCriteriaOrderByItem(sb, "`name`", criteriaOrderBy.getName());
            subCount += appendCriteriaOrderByItem(sb, "sort", criteriaOrderBy.getSort());
            subCount += appendCriteriaOrderByItem(sb, "pcode", criteriaOrderBy.getPcode());
            subCount += appendCriteriaOrderByItem(sb, "icon", criteriaOrderBy.getIcon());
            subCount += appendCriteriaOrderByItem(sb, "create_time", criteriaOrderBy.getCreateTime());
            subCount += appendCriteriaOrderByItem(sb, "`path`", criteriaOrderBy.getPath());
            if (subCount > 1) {
                throw new Exception("order by数组元素对象属性多于1个");
            }
        }
        if (sb.length() == 0) {
            appendCriteriaOrderByItem(sb, "1", "");
        }

        return sb.toString();
    }

    private static int setCriteriaEqualTo(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdEqualTo(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeEqualTo(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeEqualTo(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameEqualTo(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortEqualTo(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeEqualTo(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconEqualTo(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeEqualTo(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathEqualTo(request.getPath());
        }

        return count;
    }

    private static int setCriteriaGreaterThan(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdGreaterThan(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeGreaterThan(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeGreaterThan(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameGreaterThan(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortGreaterThan(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeGreaterThan(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconGreaterThan(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeGreaterThan(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathGreaterThan(request.getPath());
        }

        return count;
    }

    private static int setCriteriaGreaterThanOrEqualTo(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdGreaterThanOrEqualTo(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeGreaterThanOrEqualTo(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeGreaterThanOrEqualTo(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameGreaterThanOrEqualTo(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortGreaterThanOrEqualTo(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeGreaterThanOrEqualTo(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconGreaterThanOrEqualTo(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeGreaterThanOrEqualTo(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathGreaterThanOrEqualTo(request.getPath());
        }

        return count;
    }

    private static int setCriteriaIsNotNull(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdIsNotNull();
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeIsNotNull();
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeIsNotNull();
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameIsNotNull();
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortIsNotNull();
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeIsNotNull();
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconIsNotNull();
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeIsNotNull();
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathIsNotNull();
        }

        return count;
    }

    private static int setCriteriaIsNull(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdIsNull();
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeIsNull();
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeIsNull();
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameIsNull();
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortIsNull();
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeIsNull();
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconIsNull();
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeIsNull();
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathIsNull();
        }

        return count;
    }

    private static int setCriteriaLessThan(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdLessThan(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeLessThan(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeLessThan(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameLessThan(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortLessThan(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeLessThan(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconLessThan(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeLessThan(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathLessThan(request.getPath());
        }

        return count;
    }

    private static int setCriteriaLessThanOrEqualTo(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdLessThanOrEqualTo(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeLessThanOrEqualTo(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeLessThanOrEqualTo(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameLessThanOrEqualTo(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortLessThanOrEqualTo(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeLessThanOrEqualTo(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconLessThanOrEqualTo(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeLessThanOrEqualTo(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathLessThanOrEqualTo(request.getPath());
        }

        return count;
    }

    private static int setCriteriaLike(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getCode() != null) {
            count++;
            criteria.andCodeLike(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeLike(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameLike(request.getName());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeLike(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconLike(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeLike(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathLike(request.getPath());
        }

        return count;
    }

    private static int setCriteriaNotEqualTo(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getId() != null) {
            count++;
            criteria.andIdNotEqualTo(request.getId());
        }

        if (request.getCode() != null) {
            count++;
            criteria.andCodeNotEqualTo(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeNotEqualTo(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameNotEqualTo(request.getName());
        }

        if (request.getSort() != null) {
            count++;
            criteria.andSortNotEqualTo(request.getSort());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeNotEqualTo(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconNotEqualTo(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeNotEqualTo(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathNotEqualTo(request.getPath());
        }

        return count;
    }

    private static int setCriteriaNotLike(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getCode() != null) {
            count++;
            criteria.andCodeNotLike(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeNotLike(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameNotLike(request.getName());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeNotLike(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconNotLike(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeNotLike(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathNotLike(request.getPath());
        }

        return count;
    }

    private static int setCriteriaRegexp(ProjectForMydepartment request, Criteria criteria) {
        int count = 0;

        if (request.getCode() != null) {
            count++;
            criteria.andCodeRegexp(request.getCode());
        }

        if (request.getOrganizationCode() != null) {
            count++;
            criteria.andOrganizationCodeRegexp(request.getOrganizationCode());
        }

        if (request.getName() != null) {
            count++;
            criteria.andNameRegexp(request.getName());
        }

        if (request.getPcode() != null) {
            count++;
            criteria.andPcodeRegexp(request.getPcode());
        }

        if (request.getIcon() != null) {
            count++;
            criteria.andIconRegexp(request.getIcon());
        }

        if (request.getCreateTime() != null) {
            count++;
            criteria.andCreateTimeRegexp(request.getCreateTime());
        }

        if (request.getPath() != null) {
            count++;
            criteria.andPathRegexp(request.getPath());
        }

        return count;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andCodeIsNull() {
            addCriterion("code is null");
            return (Criteria) this;
        }

        public Criteria andCodeIsNotNull() {
            addCriterion("code is not null");
            return (Criteria) this;
        }

        public Criteria andCodeEqualTo(String value) {
            addCriterion("code =", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeNotEqualTo(String value) {
            addCriterion("code <>", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeGreaterThan(String value) {
            addCriterion("code >", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeGreaterThanOrEqualTo(String value) {
            addCriterion("code >=", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeLessThan(String value) {
            addCriterion("code <", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeLessThanOrEqualTo(String value) {
            addCriterion("code <=", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeRegexp(String value) {
            addCriterion("code regexp", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeLike(String value) {
            addCriterion("code like", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeNotLike(String value) {
            addCriterion("code not like", value, "code");
            return (Criteria) this;
        }

        public Criteria andCodeIn(List<String> values) {
            addCriterion("code in", values, "code");
            return (Criteria) this;
        }

        public Criteria andCodeNotIn(List<String> values) {
            addCriterion("code not in", values, "code");
            return (Criteria) this;
        }

        public Criteria andCodeBetween(String value1, String value2) {
            addCriterion("code between", value1, value2, "code");
            return (Criteria) this;
        }

        public Criteria andCodeNotBetween(String value1, String value2) {
            addCriterion("code not between", value1, value2, "code");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeIsNull() {
            addCriterion("organization_code is null");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeIsNotNull() {
            addCriterion("organization_code is not null");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeEqualTo(String value) {
            addCriterion("organization_code =", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeNotEqualTo(String value) {
            addCriterion("organization_code <>", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeGreaterThan(String value) {
            addCriterion("organization_code >", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeGreaterThanOrEqualTo(String value) {
            addCriterion("organization_code >=", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeLessThan(String value) {
            addCriterion("organization_code <", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeLessThanOrEqualTo(String value) {
            addCriterion("organization_code <=", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeRegexp(String value) {
            addCriterion("organization_code regexp", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeLike(String value) {
            addCriterion("organization_code like", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeNotLike(String value) {
            addCriterion("organization_code not like", value, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeIn(List<String> values) {
            addCriterion("organization_code in", values, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeNotIn(List<String> values) {
            addCriterion("organization_code not in", values, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeBetween(String value1, String value2) {
            addCriterion("organization_code between", value1, value2, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andOrganizationCodeNotBetween(String value1, String value2) {
            addCriterion("organization_code not between", value1, value2, "organizationCode");
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("`name` is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("`name` is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(String value) {
            addCriterion("`name` =", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(String value) {
            addCriterion("`name` <>", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(String value) {
            addCriterion("`name` >", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(String value) {
            addCriterion("`name` >=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThan(String value) {
            addCriterion("`name` <", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(String value) {
            addCriterion("`name` <=", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameRegexp(String value) {
            addCriterion("`name` regexp", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameLike(String value) {
            addCriterion("`name` like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotLike(String value) {
            addCriterion("`name` not like", value, "name");
            return (Criteria) this;
        }

        public Criteria andNameIn(List<String> values) {
            addCriterion("`name` in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<String> values) {
            addCriterion("`name` not in", values, "name");
            return (Criteria) this;
        }

        public Criteria andNameBetween(String value1, String value2) {
            addCriterion("`name` between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(String value1, String value2) {
            addCriterion("`name` not between", value1, value2, "name");
            return (Criteria) this;
        }

        public Criteria andSortIsNull() {
            addCriterion("sort is null");
            return (Criteria) this;
        }

        public Criteria andSortIsNotNull() {
            addCriterion("sort is not null");
            return (Criteria) this;
        }

        public Criteria andSortEqualTo(Integer value) {
            addCriterion("sort =", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortNotEqualTo(Integer value) {
            addCriterion("sort <>", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortGreaterThan(Integer value) {
            addCriterion("sort >", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortGreaterThanOrEqualTo(Integer value) {
            addCriterion("sort >=", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortLessThan(Integer value) {
            addCriterion("sort <", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortLessThanOrEqualTo(Integer value) {
            addCriterion("sort <=", value, "sort");
            return (Criteria) this;
        }

        public Criteria andSortIn(List<Integer> values) {
            addCriterion("sort in", values, "sort");
            return (Criteria) this;
        }

        public Criteria andSortNotIn(List<Integer> values) {
            addCriterion("sort not in", values, "sort");
            return (Criteria) this;
        }

        public Criteria andSortBetween(Integer value1, Integer value2) {
            addCriterion("sort between", value1, value2, "sort");
            return (Criteria) this;
        }

        public Criteria andSortNotBetween(Integer value1, Integer value2) {
            addCriterion("sort not between", value1, value2, "sort");
            return (Criteria) this;
        }

        public Criteria andPcodeIsNull() {
            addCriterion("pcode is null");
            return (Criteria) this;
        }

        public Criteria andPcodeIsNotNull() {
            addCriterion("pcode is not null");
            return (Criteria) this;
        }

        public Criteria andPcodeEqualTo(String value) {
            addCriterion("pcode =", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeNotEqualTo(String value) {
            addCriterion("pcode <>", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeGreaterThan(String value) {
            addCriterion("pcode >", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeGreaterThanOrEqualTo(String value) {
            addCriterion("pcode >=", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeLessThan(String value) {
            addCriterion("pcode <", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeLessThanOrEqualTo(String value) {
            addCriterion("pcode <=", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeRegexp(String value) {
            addCriterion("pcode regexp", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeLike(String value) {
            addCriterion("pcode like", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeNotLike(String value) {
            addCriterion("pcode not like", value, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeIn(List<String> values) {
            addCriterion("pcode in", values, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeNotIn(List<String> values) {
            addCriterion("pcode not in", values, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeBetween(String value1, String value2) {
            addCriterion("pcode between", value1, value2, "pcode");
            return (Criteria) this;
        }

        public Criteria andPcodeNotBetween(String value1, String value2) {
            addCriterion("pcode not between", value1, value2, "pcode");
            return (Criteria) this;
        }

        public Criteria andIconIsNull() {
            addCriterion("icon is null");
            return (Criteria) this;
        }

        public Criteria andIconIsNotNull() {
            addCriterion("icon is not null");
            return (Criteria) this;
        }

        public Criteria andIconEqualTo(String value) {
            addCriterion("icon =", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotEqualTo(String value) {
            addCriterion("icon <>", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconGreaterThan(String value) {
            addCriterion("icon >", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconGreaterThanOrEqualTo(String value) {
            addCriterion("icon >=", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLessThan(String value) {
            addCriterion("icon <", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLessThanOrEqualTo(String value) {
            addCriterion("icon <=", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconRegexp(String value) {
            addCriterion("icon regexp", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLike(String value) {
            addCriterion("icon like", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotLike(String value) {
            addCriterion("icon not like", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconIn(List<String> values) {
            addCriterion("icon in", values, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotIn(List<String> values) {
            addCriterion("icon not in", values, "icon");
            return (Criteria) this;
        }

        public Criteria andIconBetween(String value1, String value2) {
            addCriterion("icon between", value1, value2, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotBetween(String value1, String value2) {
            addCriterion("icon not between", value1, value2, "icon");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNull() {
            addCriterion("create_time is null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNotNull() {
            addCriterion("create_time is not null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeEqualTo(String value) {
            addCriterion("create_time =", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotEqualTo(String value) {
            addCriterion("create_time <>", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThan(String value) {
            addCriterion("create_time >", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThanOrEqualTo(String value) {
            addCriterion("create_time >=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThan(String value) {
            addCriterion("create_time <", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThanOrEqualTo(String value) {
            addCriterion("create_time <=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeRegexp(String value) {
            addCriterion("create_time regexp", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLike(String value) {
            addCriterion("create_time like", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotLike(String value) {
            addCriterion("create_time not like", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIn(List<String> values) {
            addCriterion("create_time in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotIn(List<String> values) {
            addCriterion("create_time not in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeBetween(String value1, String value2) {
            addCriterion("create_time between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotBetween(String value1, String value2) {
            addCriterion("create_time not between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andPathIsNull() {
            addCriterion("`path` is null");
            return (Criteria) this;
        }

        public Criteria andPathIsNotNull() {
            addCriterion("`path` is not null");
            return (Criteria) this;
        }

        public Criteria andPathEqualTo(String value) {
            addCriterion("`path` =", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathNotEqualTo(String value) {
            addCriterion("`path` <>", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathGreaterThan(String value) {
            addCriterion("`path` >", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathGreaterThanOrEqualTo(String value) {
            addCriterion("`path` >=", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathLessThan(String value) {
            addCriterion("`path` <", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathLessThanOrEqualTo(String value) {
            addCriterion("`path` <=", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathRegexp(String value) {
            addCriterion("`path` regexp", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathLike(String value) {
            addCriterion("`path` like", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathNotLike(String value) {
            addCriterion("`path` not like", value, "path");
            return (Criteria) this;
        }

        public Criteria andPathIn(List<String> values) {
            addCriterion("`path` in", values, "path");
            return (Criteria) this;
        }

        public Criteria andPathNotIn(List<String> values) {
            addCriterion("`path` not in", values, "path");
            return (Criteria) this;
        }

        public Criteria andPathBetween(String value1, String value2) {
            addCriterion("`path` between", value1, value2, "path");
            return (Criteria) this;
        }

        public Criteria andPathNotBetween(String value1, String value2) {
            addCriterion("`path` not between", value1, value2, "path");
            return (Criteria) this;
        }

    }

    public static class CriteriaString {
        private String id;

        public String getId() {
            return id;
        }
        public void setId(String _v) {
            id = _v;
        }
        private String code;

        public String getCode() {
            return code;
        }
        public void setCode(String _v) {
            code = _v;
        }
        private String organizationCode;

        public String getOrganizationCode() {
            return organizationCode;
        }
        public void setOrganizationCode(String _v) {
            organizationCode = _v;
        }
        private String name;

        public String getName() {
            return name;
        }
        public void setName(String _v) {
            name = _v;
        }
        private String sort;

        public String getSort() {
            return sort;
        }
        public void setSort(String _v) {
            sort = _v;
        }
        private String pcode;

        public String getPcode() {
            return pcode;
        }
        public void setPcode(String _v) {
            pcode = _v;
        }
        private String icon;

        public String getIcon() {
            return icon;
        }
        public void setIcon(String _v) {
            icon = _v;
        }
        private String createTime;

        public String getCreateTime() {
            return createTime;
        }
        public void setCreateTime(String _v) {
            createTime = _v;
        }
        private String path;

        public String getPath() {
            return path;
        }
        public void setPath(String _v) {
            path = _v;
        }
    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }
}
